package com.woniuxy.oa.service.impl;
 
import java.sql.SQLException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.woniuxy.oa.entity.Employee;
import com.woniuxy.oa.exception.ServiceException;
import com.woniuxy.oa.mapper.LoginMapper;
import com.woniuxy.oa.service.LoginService;

@Service("LoginService")
public class LoginServiceImpl implements LoginService {
	@Autowired
	LoginMapper loginMapper;

	@Override
	public Employee selectEmployeeByAccount(String account) {
		Employee employee= loginMapper.selectEmployeeByAccount(account);
		if(employee!=null) {
			return employee;
		}else {
			//没有查到用户，抛出异常
			throw new ServiceException("账号不存在");
		}
			
			
		}

	@Override
	public void modifyPassword(String password, String account) {
		loginMapper.modifyPassword(password, account);
		
	}
}